﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.Framework.Utils;

namespace CNVP.JShop.Web.Controls
{
    public partial class LookReview : System.Web.UI.Page
    {
        string ReviewID = string.Empty;
        string OrderProductsID = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            ReviewID = Request.QueryString["ReviewID"];
            if (string.IsNullOrEmpty(ReviewID) || !Public.IsNumber(ReviewID))
            {
                ReviewID = "0";
            }
            OrderProductsID = Request.Params["OrderProductsID"];
            if (string.IsNullOrEmpty(OrderProductsID) || !Public.IsNumber(OrderProductsID))
            {
                OrderProductsID = "0";
            }

            if (!IsPostBack)
            {
                BLL.CNVP_Review bll = new BLL.CNVP_Review();
                var model = bll.GetSingle_CNVP_ReviewById(Convert.ToInt32(ReviewID));
                if (model != null)
                {
                    LiterrateStatus.Text = new BLL.BLLRateStatus().GetRateStatus(model.rateStatus);
                    LiterProductName.Text = new BLL.CNVP_OrderProducts().GetSingle_CNVP_OrderProductsById(Convert.ToInt32(OrderProductsID)).ProductName;
                    LiterReviewTitle.Text = model.ReviewTitle;
                    LiterReviewContent.Text = model.ReviewContent;
                    if (!string.IsNullOrEmpty(model.LastReplyContent))
                    {
                        LiterReplyText.Text = "<font color=\"red\">回复人：" + model.LastReplyAuthor + " 回复时间：" + model.LastReplyTime + " <br/>回复内容：" + model.LastReplyContent + "</font>";
                    }
                }
            }
        }
    }
}